package transview;

import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import engine.Edge;
import engine.Engine;
import gui.MainFrame;
import gui.MapPanel;
import java.util.ArrayList;
import javax.swing.JFrame;

/**
 * @author Johnny Levai
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    try {
      javax.swing.UIManager.setLookAndFeel(new WindowsLookAndFeel());
    } catch (Exception e) {System.out.println("UI baj");}
        JFrame jf = new MainFrame();

        MapPanel mp = new MapPanel();
        jf.getContentPane().add(mp);
        jf.pack();
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.setVisible(true);

        Engine engine = new Engine();
        ArrayList<Edge> edgeList = engine.getEdges();
        Edge edgeArray[] = new Edge[edgeList.size()];
        mp.setEdges(edgeList.toArray(edgeArray));
        mp.refreshImage();
    }

}
